/**
 * Witontek.com.
 * Copyright (c) 2012-2016 All Rights Reserved.
 */
package test.random;

import java.util.Random;

/**
 * 
 * @author Long
 * @version $Id: RandomDemo.java, v 0.1 2016年10月25日 上午10:03:10  xiaolong.ma  Exp $
 */
public class RandomDemo {

    /**
     * 
     * @param args
     */
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            System.out.println(getRandom(12));
        }
    }

    private static String getRandom(int length) {
        Double d = Math.pow(10, length);
        int size = (Integer) d.intValue();
        Random r = new Random();
        return String.format("%0" + length + "d", r.nextInt(size));
    }

}
